Part 3: Tutorial 01 (7.0-7.5)
Published:
(this tutorial is work-in progress…)
Tutorial 1:
In OptiX, before starting ray tracing on the GPU, it is necessary to copy data from the CPU side to the GPU side, build an AS, build an SBT, etc.
- create Context (optix, device, and cuda context)
- crease Acceleration Structure (aka, build)
- create Module (that holds the programs from CUDA, called shader in OpenGL, Vulkan, and DX)
- create Program Group/s (hold one or more Modules)
- create Pipeline
- create Shader Binding Table
Programs
- Closest Hit Program: most common, and it is executed when there is the closest intersection between ray and object. Typically the purpose of the closest hit program is to determine the color of the intersection point. The user can create multiple closest hit programs and bind each to objects in the scene, so that different objects may have different appearances Ref: game work library documentation, older optix version.
- Miss Program:
- Ray Generation Program: To create the rays themselves, we will use a pinhole camera model. The ray generation program is responsible for creating a ray, shooting it into the scene, and copying the resulting color into an output buffer. Output buffers are subsequently used by the host for further analysis or by OpenGL for rendering. OptiX can write to an arbitrary number of output buffers, and those buffers can have arbitrary types.
The single output buffer is a two-dimensional RGBA8 image that is designed for efficient transfer to an OpenGL texture.